<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" %>

<!DOCTYPE html>
<html>
<head>
    <jsp:include page="/WEB-INF/jsp/admin/include/headBase.jsp"/>
    <jsp:include page="/WEB-INF/jsp/admin/include/footerBase.jsp"/>
</head>
<body style="padding: 5px">
<div class="nav-tabs-custom">
    <ul class="nav nav-tabs">
        <li class="active">
            <a href="#tab_automatic" data-toggle="tab">
                <span class="glyphicon glyphicon-user"></span><b>自动抽取</b></a></li>
        <li>
            <a href="#tab_manually" data-toggle="tab">
                <span class="glyphicon glyphicon-home"></span><b>手动抽取</b></a></li>
        <li>
            <a href="#tab_result" data-toggle="tab">
                <span class="glyphicon glyphicon-book"></span><b>抽取结果</b></a></li>
    </ul>
    <div class="tab-content" >
        <%--1自动抽取--%>
        <div class="tab-pane active" id="tab_automatic" data-url="${base}/httpPage/automatic?idCard=${idCard}">
            <jsp:include page="automatic.jsp"></jsp:include>
        </div>
        <%--2手动抽取--%>
        <div class="tab-pane" id="tab_manually" data-url="${base}/httpPage/manually?idCard=${idCard}">
            <jsp:include page="manually.jsp"></jsp:include>
        </div>
        <%--3抽取结果--%>
        <div class="tab-pane" id="tab_result" data-url="${base}/httpPage/result?idCard=${idCard}">
            <jsp:include page="result.jsp"></jsp:include>
        </div>
    </div>
</div>


<div class="modal fade" id="modal_expertInfos">
    <div class="modal-dialog  modal-lg ">
        <div class="modal-content ">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 style="display: inline" class="modal-title">基本信息</h4>
            </div>
            <div class="modal-body" style="padding:5px 10px; ">
                <iframe id="ifm_epxertInfo"
                        style="padding-top: 0px;" width=100% height=100% frameBorder=0 scrolling=no></iframe>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<div class="modal fade" id="myModal">
    <div class="modal-dialog  modal-lg ">
        <div class="modal-content ">
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script>
    var $table_result = $("#table_result"),
            $table_search_manual = $("#table_search_manual");
    $table_search_auto = $("#table_search_auto");

    window.events = {

        'click .nameClick': function (e, value, row, index) {
            $('#myModal').modal({
                backdrop: 'static',
                keyboard: false,
                show: true,
                remote: '${base}/httpPage/expertInfoDlg?idCard=' + row.idCard
            });
        },

        'click .checkExpert': function (e, value, row, index) {
            $table_result.bootstrapTable('insertRow', {index: 0, row: row});
            $table_search_manual.bootstrapTable('updateRow', {index: index, row: row});
        },

        'click .checkLeader': function (e, value, row, index) {
            $table_result.bootstrapTable('removeAll');
            var data = $table_search_auto.bootstrapTable('getOptions').data;
            for (var i = 0; i < data.length; i++) {
                $table_result.bootstrapTable('insertRow', {index: i, row: data[i]});
            }
            $table_result.bootstrapTable('check', 0);
        },

        'click .unCheckExpert': function (e, value, row, index) {
            $table_result.bootstrapTable('remove', {field: 'idCard', values: [row.idCard]});
            var data = $table_search_manual.bootstrapTable('getOptions').data, str = "";
            for (var i = 0; i < data.length; i++) {
                if (row.idCard == data[i].idCard) {
                    $table_search_manual.bootstrapTable('updateRow', {index: i, row: row});
                }
            }
        }


    };
</script>
<script>


    $("#myModal").on("hidden.bs.modal", function () {
        $(this).removeData("bs.modal");
        $(this).find(".modal-content").html("");
    });

    $.sysPlugin.initDateTimeInput();
    $.sysPlugin.initSimpleSelect2();
</script>

<%--<script language="javascript">--%>
<%--$(".nav-tabs a").click(function () {--%>
<%--var $content = $($(this).attr("href"));--%>
<%--if ($content.html().length < 6) {--%>
<%--$content.load($content.data("url")); // ajax加载页面--%>
<%--}--%>
<%--});--%>
<%--$("#tab_automatic").load($("#tab_automatic").data("url"));--%>
<%--</script>--%>

</body>
</html>